<div class="gallery">
<?php


$sql="Select * from  portal_gallery where portalId=$portalId";

$rs=ew_LoadRecordset($sql);

while(!$rs->EOF)
{
    $img=$rs->fields["picture"];
    $title=$rs->fields["title_".$LANG];
?>
    <div class="image">
    
    
        <?php if (!isset($app_shop_watermark)) { ?>
        
 <a rel="gallery" href="<?php echo "/".getFilesPath("gallery")."/".$img; ?>" class="shadowBox frame"><img width="250" height="200"  src="<?php echo "/".getFilesPath("gallery")."/".$img; ?>" alt="">
<?php } else { ?>

<a rel="gallery" href="/apps/watermark.php?image=<?php echo "/".getFilesPath("gallery")."/".$img; ?>&stamp=<?php echo "/".getFilesPath("image")."/".$app_shop_watermark; ?>" class=" frame"><img   src="/php/phpthumb/phpThumb.php?src=<?php echo "/".getFilesPath("gallery")."/".$img; ?>&w=217" alt="">

<?php } ?>
      
    
    
<br/>
<?php echo $title; ?>
</a>
    </div>
<?php

    $rs->MoveNext();
}

?>
</div>


<script type="text/javascript">

    $(document).ready(function() {
        $("a.frame").fancybox();
    });
</script>